* keyboard.c: Integer and memory overflow fixes.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 29 Jul 2011 00:30:00 +0000 (17:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 29 Jul 2011 00:30:00 +0000 (17:30 -0700)
commita4a6a07844a2c9ce08bc7b347e5e0b5ce62b5e4d
tree7c720e4867db18afb75a92269b58dfdacc239bbb
parent2428a65d99b1dde2bf71210ede0427fa5e1ff719
* keyboard.c: Integer and memory overflow fixes.

(read_char, menu_bar_items, tool_bar_items, read_char_x_menu_prompt)
(read_char_minibuf_menu_width, read_char_minibuf_menu_prompt)
(follow_key, read_key_sequence): Use ptrdiff_t, not int, to count maps.
(read_char_minibuf_menu_prompt): Check for overflow in size
calculations.  Don't update size until allocation succeeds.  Redo
calculations to avoid overflow.
* keyboard.h: Change prototypes to match the above.
src/ChangeLog
src/keyboard.c
src/keyboard.h